/*
 Navicat Premium Data Transfer

 Source Server         : Homestead
 Source Server Type    : MySQL
 Source Server Version : 50722
 Source Host           : 127.0.0.1:33060
 Source Schema         : bm_consumer

 Target Server Type    : MySQL
 Target Server Version : 50722
 File Encoding         : 65001

 Date: 15/07/2019 11:52:20
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for admin_users
-- ----------------------------
DROP TABLE IF EXISTS `admin_users`;
CREATE TABLE `admin_users` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '用户昵称',
  `username` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '用户名',
  `password` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '密码',
  `status` tinyint(1) DEFAULT '0' COMMENT '状态，是否启用',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `username` (`username`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='后台管理员表';

-- ----------------------------
-- Records of admin_users
-- ----------------------------
BEGIN;
INSERT INTO `admin_users` VALUES (1, '超级管理员', 'admin', '$2y$10$Uhj0q4mlsl/ZYRA5IZlXP.WxXfkFWtKJpschVwejsksogDri17oJq', 0, '2019-07-15 11:17:18', '2019-07-15 11:17:18');
COMMIT;

-- ----------------------------
-- Table structure for consultants
-- ----------------------------
DROP TABLE IF EXISTS `consultants`;
CREATE TABLE `consultants` (
  `id` int(10) NOT NULL,
  `nickname` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '微信昵称',
  `avatar` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '头像地址',
  `remark` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '备注',
  `wechat` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '微信号',
  `phone` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '手机号',
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '员工姓名',
  `work_num` int(10) NOT NULL COMMENT '员工工号',
  `status` tinyint(1) DEFAULT NULL COMMENT '账户状态 0关闭 1开启',
  `group` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '所属平台',
  `qr_code` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '微信二维码地址',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='顾问表';

-- ----------------------------
-- Table structure for keyword_replies
-- ----------------------------
DROP TABLE IF EXISTS `keyword_replies`;
CREATE TABLE `keyword_replies` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `rule_id` int(10) DEFAULT NULL COMMENT '关键字规则id',
  `material_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '图文/图片类型的素材id',
  `type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '回复类型',
  `content` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '对于文本类型，content是文本内容，图文是标题内容，图片是链接地址',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='关键字回复-回复内容表';

-- ----------------------------
-- Records of keyword_replies
-- ----------------------------
BEGIN;
INSERT INTO `keyword_replies` VALUES (1, 2, '34', 'news', '单图文第一条', '2019-07-13 11:38:45', '2019-07-13 11:38:45');
INSERT INTO `keyword_replies` VALUES (2, 2, NULL, 'text', 'hello', '2019-07-13 11:38:45', '2019-07-13 11:38:45');
INSERT INTO `keyword_replies` VALUES (3, 2, '27', 'image', 'http://mmbiz.qpic.cn/mmbiz_png/5jp6jFEkES0ZOufveHKTuLPraXZzwsqSPXQibt3GxHPZicawh6ibJ9PkOvbYqeD746AO8ykByVTVFNhtH8JXibXDyA/0?wx_fmt=png', '2019-07-13 11:38:45', '2019-07-13 11:38:45');
COMMIT;

-- ----------------------------
-- Table structure for keyword_rules
-- ----------------------------
DROP TABLE IF EXISTS `keyword_rules`;
CREATE TABLE `keyword_rules` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `rule_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '规则名称',
  `keyword` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '关键字',
  `reply_mode` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '回复模式，reply_all 表示全部回复，reply_one 表示随机回复一条',
  `reply_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '回复内容类型',
  `reply_content` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '回复内容',
  `status` tinyint(1) DEFAULT NULL COMMENT '状态 0关闭 1开启',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='关键字回复规则表';

-- ----------------------------
-- Records of keyword_rules
-- ----------------------------
BEGIN;
INSERT INTO `keyword_rules` VALUES (2, '测试', '111', 'reply_all', 'news', '单图文第一条', 1, '2019-07-13 11:38:45', '2019-07-13 11:38:45');
COMMIT;

-- ----------------------------
-- Table structure for materials
-- ----------------------------
DROP TABLE IF EXISTS `materials`;
CREATE TABLE `materials` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '素材类型，image/video/voice/news',
  `media_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '微信素材id',
  `index` tinyint(1) unsigned DEFAULT NULL COMMENT '多图文文章顺序',
  `title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '图文标题',
  `thumb_media_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '图文消息封面素材id',
  `thumb_url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '封面图链接地址',
  `show_cover_pic` tinyint(1) DEFAULT NULL COMMENT '是否显示封面图',
  `author` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '作者',
  `digest` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '图文摘要',
  `content` text COLLATE utf8mb4_unicode_ci COMMENT '图文正文',
  `content_source_url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '原文地址链接',
  `url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '图文或素材的url',
  `need_open_comment` tinyint(1) DEFAULT NULL COMMENT '是否开启留言',
  `only_fans_can_comment` tinyint(1) DEFAULT NULL COMMENT '只有粉丝可以留言',
  `update_time` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '图文消息最后的更新时间',
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '图片/视频/语音文件名称',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='微信素材表\n';

-- ----------------------------
-- Records of materials
-- ----------------------------
BEGIN;
INSERT INTO `materials` VALUES (24, 'image', 'Vf8p1BTrzqM6MOZglUrwXBt02xj2zqnVpd36tkHmWXI', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'http://mmbiz.qpic.cn/mmbiz_jpg/qVcicVBGr9DHe8QicoJiakiaANy618HbeywFOUlLMTjdiaGCDxicHsE3oehzuq8NW6D1ZzPCy21WQTDLqvul02K5a6icg/0?wx_fmt=jpeg', NULL, NULL, '1562929249', 'test', '2019-07-12 20:14:58', '2019-07-12 20:14:58');
INSERT INTO `materials` VALUES (25, 'image', 'Vf8p1BTrzqM6MOZglUrwXFI4QNFrwZ8_2w-YCiq8Tk8', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'http://mmbiz.qpic.cn/mmbiz_jpg/qVcicVBGr9DEfOqJmcGjprdwZzlM3bvpWR3fseSFVoM91r5BzQdghAhOicAC5eibVpricWrerrsYXdCtSnyApLaTrg/0?wx_fmt=jpeg', NULL, NULL, '1562929960', 'gt', '2019-07-12 20:14:58', '2019-07-12 20:14:58');
INSERT INTO `materials` VALUES (26, 'image', 'Vf8p1BTrzqM6MOZglUrwXJEqSmicG722nke6wHH6CCk', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'http://mmbiz.qpic.cn/mmbiz_jpg/qVcicVBGr9DERrsKxeZ3FSRWVmKGcJNwyxQI2kiabAwntg3Dj8zMGHg9w2mUbPJQmF6MWk0GuIe36mZ4378mqGlg/0?wx_fmt=jpeg', NULL, NULL, '1562929962', 'ww', '2019-07-12 20:14:58', '2019-07-12 20:14:58');
INSERT INTO `materials` VALUES (27, 'image', '7tXTiDsUpBJzU-3wbsvogeiVsRYHf8JuIM3Q93Z4cPs', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'http://mmbiz.qpic.cn/mmbiz_png/5jp6jFEkES0ZOufveHKTuLPraXZzwsqSPXQibt3GxHPZicawh6ibJ9PkOvbYqeD746AO8ykByVTVFNhtH8JXibXDyA/0?wx_fmt=png', NULL, NULL, NULL, NULL, '2019-07-13 10:20:49', '2019-07-13 10:20:49');
INSERT INTO `materials` VALUES (28, 'news', '7tXTiDsUpBJzU-3wbsvogSORx6ADzCc92yp8vsI8-rQ', 0, '多图文第一条', '7tXTiDsUpBJzU-3wbsvogeiVsRYHf8JuIM3Q93Z4cPs', 'http://mmbiz.qpic.cn/mmbiz_png/5jp6jFEkES0ZOufveHKTuLPraXZzwsqSPXQibt3GxHPZicawh6ibJ9PkOvbYqeD746AO8ykByVTVFNhtH8JXibXDyA/0?wx_fmt=png', 1, 'iron', 'nothing gonna change', '<section style=\'background-color: rgb(255, 255, 255);box-sizing: border-box;\'></section>', '', 'http://mp.weixin.qq.com/s?__biz=MzI3ODYxODU1Nw==&mid=100000002&idx=1&sn=1cd130addb4f02e39c402bc0f08edaba&chksm=6b5509d05c2280c6a607f2120accc704d76a47672d57857166304745c1575b2685cd9c669f01#rd', 1, 1, '1562987272', NULL, '2019-07-13 11:08:06', '2019-07-13 11:10:14');
INSERT INTO `materials` VALUES (29, 'news', '7tXTiDsUpBJzU-3wbsvogSORx6ADzCc92yp8vsI8-rQ', 1, '多图文第二条', '7tXTiDsUpBJzU-3wbsvogeiVsRYHf8JuIM3Q93Z4cPs', 'http://mmbiz.qpic.cn/mmbiz_png/5jp6jFEkES0ZOufveHKTuLPraXZzwsqSPXQibt3GxHPZicawh6ibJ9PkOvbYqeD746AO8ykByVTVFNhtH8JXibXDyA/0?wx_fmt=png', 1, 'iron', 'nothing gonna change', '<section style=\'background-color: rgb(255, 255, 255);box-sizing: border-box;\'></section>', '', 'http://mp.weixin.qq.com/s?__biz=MzI3ODYxODU1Nw==&mid=100000002&idx=2&sn=40598b6d322fca7cf703d2171f0df9c1&chksm=6b5509d05c2280c600f759a1d5382e497f9961212494be61c22a19334b06120ef7170e6582e3#rd', 1, 1, '1562987272', NULL, '2019-07-13 11:08:06', '2019-07-13 11:10:14');
INSERT INTO `materials` VALUES (30, 'news', '7tXTiDsUpBJzU-3wbsvogSORx6ADzCc92yp8vsI8-rQ', 2, '多图文第三条', '7tXTiDsUpBJzU-3wbsvogeiVsRYHf8JuIM3Q93Z4cPs', 'http://mmbiz.qpic.cn/mmbiz_png/5jp6jFEkES0ZOufveHKTuLPraXZzwsqSPXQibt3GxHPZicawh6ibJ9PkOvbYqeD746AO8ykByVTVFNhtH8JXibXDyA/0?wx_fmt=png', 1, 'iron', 'nothing gonna change', '<section style=\'background-color: rgb(255, 255, 255);box-sizing: border-box;\'></section>', '', 'http://mp.weixin.qq.com/s?__biz=MzI3ODYxODU1Nw==&mid=100000002&idx=3&sn=32c3c45d10ee4973d4b33fe7d8bb0037&chksm=6b5509d05c2280c67e778b89e4945b4753c670d5915ade9c3215b04cebe92b9bb72b5e733e56#rd', 1, 1, '1562987272', NULL, '2019-07-13 11:08:06', '2019-07-13 11:10:14');
INSERT INTO `materials` VALUES (31, 'news', '7tXTiDsUpBJzU-3wbsvogYzKnAjVB3G2Woqs02Lz4P0', 0, '多图文第一条', '7tXTiDsUpBJzU-3wbsvogeiVsRYHf8JuIM3Q93Z4cPs', NULL, 1, 'iron', 'nothing gonna change', '<section style=\"background-color: rgb(255, 255, 255);box-sizing: border-box;\"><section class=\"Powered-by-XIUMI V5\"style=\"box-sizing: border-box;\"powered-by=\"xiumi.us\"><section class=\"\"style=\"box-sizing: border-box;\"><section class=\"\"style=\"box-sizing: border-box;\"><p style=\"box-sizing: border-box;\">首先，先介绍一下关于分时图的几个基本概念，以便大家更好掌握后续分析的内容。</p></section></section></section><section class=\"Powered-by-XIUMI V5\"style=\"box-sizing: border-box;\"powered-by=\"xiumi.us\"><section class=\"\"style=\"text-align: center;margin-top: 10px;margin-bottom: 10px;box-sizing: border-box;\"><section class=\"\"style=\"max-width: 100%;vertical-align: middle;display: inline-block;overflow: hidden !important;box-sizing: border-box;\"><img data-ratio=\"0.8870968\"data-src=\"http://mmbiz.qpic.cn/mmbiz_png/5jp6jFEkES0ZOufveHKTuLPraXZzwsqSPXQibt3GxHPZicawh6ibJ9PkOvbYqeD746AO8ykByVTVFNhtH8JXibXDyA/0?wx_fmt=png\"data-type=\"jpeg\"data-w=\"558\"style=\"vertical-align: middle;box-sizing: border-box;\"></section></section></section></section>', NULL, NULL, 1, 1, NULL, NULL, '2019-07-13 11:17:21', '2019-07-13 11:17:21');
INSERT INTO `materials` VALUES (32, 'news', '7tXTiDsUpBJzU-3wbsvogYzKnAjVB3G2Woqs02Lz4P0', 1, '多图文第二条', '7tXTiDsUpBJzU-3wbsvogeiVsRYHf8JuIM3Q93Z4cPs', NULL, 1, 'iron', 'nothing gonna change', '<section style=\"background-color: rgb(255, 255, 255);box-sizing: border-box;\"><section class=\"Powered-by-XIUMI V5\"style=\"box-sizing: border-box;\"powered-by=\"xiumi.us\"><section class=\"\"style=\"box-sizing: border-box;\"><section class=\"\"style=\"box-sizing: border-box;\"><p style=\"box-sizing: border-box;\">首先，先介绍一下关于分时图的几个基本概念，以便大家更好掌握后续分析的内容。</p></section></section></section><section class=\"Powered-by-XIUMI V5\"style=\"box-sizing: border-box;\"powered-by=\"xiumi.us\"><section class=\"\"style=\"text-align: center;margin-top: 10px;margin-bottom: 10px;box-sizing: border-box;\"><section class=\"\"style=\"max-width: 100%;vertical-align: middle;display: inline-block;overflow: hidden !important;box-sizing: border-box;\"><img data-ratio=\"0.8870968\"data-src=\"http://mmbiz.qpic.cn/mmbiz_png/5jp6jFEkES0ZOufveHKTuLPraXZzwsqSPXQibt3GxHPZicawh6ibJ9PkOvbYqeD746AO8ykByVTVFNhtH8JXibXDyA/0?wx_fmt=png\"data-type=\"jpeg\"data-w=\"558\"style=\"vertical-align: middle;box-sizing: border-box;\"></section></section></section></section>', NULL, NULL, 1, 1, NULL, NULL, '2019-07-13 11:17:21', '2019-07-13 11:17:21');
INSERT INTO `materials` VALUES (33, 'news', '7tXTiDsUpBJzU-3wbsvogYzKnAjVB3G2Woqs02Lz4P0', 2, '多图文第三条', '7tXTiDsUpBJzU-3wbsvogeiVsRYHf8JuIM3Q93Z4cPs', NULL, 1, 'iron', 'nothing gonna change', '<section style=\"background-color: rgb(255, 255, 255);box-sizing: border-box;\"><section class=\"Powered-by-XIUMI V5\"style=\"box-sizing: border-box;\"powered-by=\"xiumi.us\"><section class=\"\"style=\"box-sizing: border-box;\"><section class=\"\"style=\"box-sizing: border-box;\"><p style=\"box-sizing: border-box;\">首先，先介绍一下关于分时图的几个基本概念，以便大家更好掌握后续分析的内容。</p></section></section></section><section class=\"Powered-by-XIUMI V5\"style=\"box-sizing: border-box;\"powered-by=\"xiumi.us\"><section class=\"\"style=\"text-align: center;margin-top: 10px;margin-bottom: 10px;box-sizing: border-box;\"><section class=\"\"style=\"max-width: 100%;vertical-align: middle;display: inline-block;overflow: hidden !important;box-sizing: border-box;\"><img data-ratio=\"0.8870968\"data-src=\"http://mmbiz.qpic.cn/mmbiz_png/5jp6jFEkES0ZOufveHKTuLPraXZzwsqSPXQibt3GxHPZicawh6ibJ9PkOvbYqeD746AO8ykByVTVFNhtH8JXibXDyA/0?wx_fmt=png\"data-type=\"jpeg\"data-w=\"558\"style=\"vertical-align: middle;box-sizing: border-box;\"></section></section></section></section>', NULL, NULL, 1, 1, NULL, NULL, '2019-07-13 11:17:21', '2019-07-13 11:17:21');
INSERT INTO `materials` VALUES (34, 'news', '7tXTiDsUpBJzU-3wbsvogRUBXNHNSu3qhg3lGdEOJIk', 0, '单图文第一条', '7tXTiDsUpBJzU-3wbsvogeiVsRYHf8JuIM3Q93Z4cPs', NULL, 1, 'iron', 'nothing gonna change', '<section style=\"background-color: rgb(255, 255, 255);box-sizing: border-box;\"><section class=\"Powered-by-XIUMI V5\"style=\"box-sizing: border-box;\"powered-by=\"xiumi.us\"><section class=\"\"style=\"box-sizing: border-box;\"><section class=\"\"style=\"box-sizing: border-box;\"><p style=\"box-sizing: border-box;\">首先，先介绍一下关于分时图的几个基本概念，以便大家更好掌握后续分析的内容。</p></section></section></section><section class=\"Powered-by-XIUMI V5\"style=\"box-sizing: border-box;\"powered-by=\"xiumi.us\"><section class=\"\"style=\"text-align: center;margin-top: 10px;margin-bottom: 10px;box-sizing: border-box;\"><section class=\"\"style=\"max-width: 100%;vertical-align: middle;display: inline-block;overflow: hidden !important;box-sizing: border-box;\"><img data-ratio=\"0.8870968\"data-src=\"http://mmbiz.qpic.cn/mmbiz_png/5jp6jFEkES0ZOufveHKTuLPraXZzwsqSPXQibt3GxHPZicawh6ibJ9PkOvbYqeD746AO8ykByVTVFNhtH8JXibXDyA/0?wx_fmt=png\"data-type=\"jpeg\"data-w=\"558\"style=\"vertical-align: middle;box-sizing: border-box;\"></section></section></section></section>', NULL, NULL, 1, 1, NULL, NULL, '2019-07-13 13:08:48', '2019-07-13 13:08:48');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
